/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package phys;

import java.util.ArrayList;

/**
 *
 * @author Vic
 */
public class Time {

    float t = 0;
    float scale;
    private static final ArrayList<Time> times = new ArrayList<>();

    public Time(float scale) {
        this.scale = scale;
        times.add(this);
    }

    public static void updateAll(float dt) {
//        synchronized (times) {
            for (int i=0;i<times.size();i++) {
                times.get(i).update(dt);
//            }
                
        }
    }

    public void update(float dt) {
        t += scale * dt;
    }

    public float getTime() {
        return t;
    }
}
